package com.itxiuyixiu.entity.mapper;

import com.itxiuyixiu.entity.model.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Update;

/**
 * @author 黄磊
 * @date 2020/5/2
 */
public interface UserWriterMapper {
    @Update("update User set username=#{username},password=#{password},authorities=#{authorities},userEmail=#{userEmail},headImage=#{headImage},nickName=#{nickName} where userId=#{userId}")
    void modifyUserById(User user);

    @Insert("insert into User(username, password, authorities, userEmail, headImage, nickName) values (#{username}, #{password}, #{authorities}, #{userEmail}, #{headImage}, #{nickName})")
    @Options(useGeneratedKeys = true, keyProperty = "userId")
    void saveUser(User user);
}
